package com.liu.controller;

import com.liu.entity.ServeBeauty;
import com.liu.entity.ServeMedical;


import com.liu.service.intf.ServerMedicalService;
import com.liu.vo.PageBeanJson;
import com.liu.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/serveMedical/")
public class ServeMedicalController {
    @Autowired
    private ServerMedicalService serverMedicalService;

    @GetMapping("list.do")
    public PageBeanJson<ServeMedical> list(int page,@RequestParam("limit")int pageSize){
        return serverMedicalService.list(page,pageSize);
    }
    //    搜索
    @GetMapping("search.do")
    public PageBeanJson<ServeMedical> search(ServeMedical serveMedical,int page,@RequestParam("limit") int pageSize){
        return serverMedicalService.search(serveMedical,page,pageSize);
    }
    //新增
    @PostMapping("insert.do")
    public R insert(ServeMedical serveMedical){
        System.out.println(serveMedical);
        return serverMedicalService.insert(serveMedical);
    }
    @PostMapping("update.do")
    public R update(ServeMedical serveMedical){
        System.out.println(serveMedical);
        return serverMedicalService.update(serveMedical);
    }
    @PostMapping("del.do")
    public R delete(int id){
        return serverMedicalService.delete(id);
    }
    @PostMapping("delBatch.do")
    public R deleteBatch(@RequestBody int[] ids){
        return serverMedicalService.deleteBatch(ids);
    }
}
